package com.glc.lpp.simulation.workstation;

import com.glc.lpp.simulation.res.Equipment;
import com.glc.lpp.simulation.res.Operator;
import com.glc.lpp.simulation.res.WorkSpace;

/**
 * 出库服务台
 *
 * @author demo
 * @version 2017-05-29
 */
public class OutStation extends WorkStation {

    public OutStation(Operator operator, Equipment equip, WorkSpace space) {
        super(operator, equip, space);
    }

    @Override
    public boolean free(int amount) {
        return operator.available - amount >= 0
                && equip.available - amount >= 0
                && space.available - amount >= 0;
    }

    @Override
    public void use(int amount) {
        operator.use(1);
        equip.use(1);
        space.use(1);
    }

    @Override
    public void restore(int amount) {
        operator.restore(amount);
        equip.restore(amount);
        space.restore(amount);
    }
}
